var limsClient = Gikam.getPageObject({

    getEditListColumns: function (readonly) {
        var editor = true
        if (readonly) {
            editor = false
        }
        return [{
            checkbox: true
        }, {
            index: true
        }, {
            field: 'clientCode',
            validators: [{
                type: 'unique',
                rule: '/secure/basemodule/rm/clients/action/validate-unique'
            }, 'strLength[0,24]', 'notEmpty'],
            title: 'T_LIMS_CLIENT.CLIENTCODE'
        }, {
            field: 'clientName',
            validators: ['strLength[0,120]', 'notEmpty'],
            title: 'T_LIMS_CLIENT.CLIENTNAME'
        }, {
            field: 'clientType',
            title: 'T_LIMS_CLIENT.CLIENTTYPE',
            editor: editor,
            type: 'select',
            firstBlank: false,
            category: 'sys',
            validators: ['notEmpty'],
            param: {
                codeCategoryId: 'customerType'
            }
        }, {
            field: 'office',
            title: 'T_LIMS_CLIENT.OFFICE',
            validators: ['strLength[0,120]'],
            editor: editor
        }, {
            field: 'contactName',
            title: 'T_LIMS_CLIENT.CONTACTNAME',
            validators: ['strLength[0,40]'],
            editor: editor
        }, {
            field: 'contactPhone',
            title: 'T_LIMS_CLIENT.CONTACTPHONE',
            validators: ['strLength[0,32]', 'phone'],
            editor: editor
        }, {
            field: 'contactEmail',
            title: 'T_LIMS_CLIENT.CONTACTEMAIL',
            validators: ['strLength[0,32]', 'email'],
            editor: editor
        }, {
            field: 'contactAddress',
            title: 'T_LIMS_CLIENT.CONTACTADDRESS',
            validators: ['strLength[0,160]'],
            editor: editor
        }, {
            field: 'clientStatus',
            title: 'T_LIMS_CLIENT.CLIENTSTATUS',
            type: 'simpleCheckbox',
        }, {
            field: 'personName',
            title: 'T_LIMS_CLIENT.PERSONNAME'
        }, {
            field: 'remark',
            title: 'T_LIMS_CLIENT.REMARK',
            validators: ['strLength[0,120]'],
            editor: editor
        }]
    },

    getBaseInfoFormFields: function () {
        return [{
            field: 'clientCode',
            title: 'T_LIMS_CLIENT.CLIENTCODE',
            validators: [{
                type: 'unique',
                rule: '/secure/basemodule/rm/clients/action/validate-unique'
            }, 'strLength[0,24]', 'notEmpty'],
            preInsert: true
        }, {
            field: 'clientName',
            title: 'T_LIMS_CLIENT.CLIENTNAME',
            validators: ['strLength[0,120]', 'notEmpty'],
            preInsert: true
        }, {
            field: 'clientType',
            title: 'T_LIMS_CLIENT.CLIENTTYPE',
            preInsert: true,
            type: 'select',
            category: 'sys',
            firstBlank: false,
            validators: ['notEmpty'],
            param: {
                codeCategoryId: 'customerType'
            }
        }, {
            field: 'office',
            title: 'T_LIMS_CLIENT.OFFICE',
            validators: ['strLength[0,120]'],
            preInsert: true
        }, {
            field: 'contactName',
            title: 'T_LIMS_CLIENT.CONTACTNAME',
            preInsert: true,
            validators: ['strLength[0,40]'],
        }, {
            field: 'contactPhone',
            title: 'T_LIMS_CLIENT.CONTACTPHONE',
            validators: ['strLength[0,24]', 'phone'],
            preInsert: true
        }, {
            field: 'contactEmail',
            title: 'T_LIMS_CLIENT.CONTACTEMAIL',
            validators: ['strLength[0,40]', 'email'],
            preInsert: true,
        }, {
            field: 'contactAddress',
            title: 'T_LIMS_CLIENT.CONTACTADDRESS',
            validators: ['strLength[0,120]'],
            preInsert: true
        }]
    },

    getChooseListColumns: function () {
        return [{
            index: true
        }, {
            field: 'clientCode',
            title: 'T_LIMS_CLIENT.CLIENTCODE'
        }, {
            field: 'clientName',
            title: 'T_LIMS_CLIENT.CLIENTNAME'
        }, {
            field: 'clientShortName',
            title: 'T_LIMS_CLIENT.CLIENTSHORTNAME'
        }, {
            field: 'aikangBranchId',
            title: 'T_LIMS_CLIENT.AIKANGBRANCHID'
        }, {
            field: 'clientType',
            title: 'T_LIMS_CLIENT.CLIENTTYPE',
        }, {
            field: 'office',
            title: 'T_LIMS_CLIENT.OFFICE',
        }, {
            field: 'contactName',
            title: 'T_LIMS_CLIENT.CONTACTNAME',
        }, {
            field: 'contactPhone',
            title: 'T_LIMS_CLIENT.CONTACTPHONE',
        }, {
            field: 'contactAddress',
            title: 'T_LIMS_CLIENT.CONTACTADDRESS',
        }, /*{
            field: 'clientStatus',
            title: 'T_LIMS_CLIENT.CLIENTSTATUS',
            type: 'select',
            category: 'sys',
            param: {
                codeCategoryId: 'activatedFlag'
            }
        },*/ {
            field: 'remark',
            title: 'T_LIMS_CLIENT.REMARK',
        }]
    },

    baseUrl: IFM_CONTEXT + '/secure/basemodule/rm/clients'
})
